package com.wys.mall.cart.service;

import com.wys.mall.cart.vo.Cart;
import com.wys.mall.cart.vo.CartItem;

import java.util.concurrent.ExecutionException;

/**
 * @Package com.wys.mall.cart.service
 * @Author charlin
 * @Version: v1.0
 * @Date 2021-07-089:50
 * @Copyright: 2021 www.wyscha.com Inc. All rights reserved.
 */
public interface CartService {

    /**
     * 添加到购物车
     * @param skuId
     * @param num
     * @return
     */
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItem getCartItem(Long skuId);

    Cart getCart() throws ExecutionException, InterruptedException;

    void clearCart(String cartKey);

    void checkItem(Long skuId, Integer checked);

    void changeItemCount(Long skuId, Integer num);

    /**
     * 删除购物项
     * @param skuId
     */
    void deleteItem(Integer skuId);
}
